package com.cloud.gatewaySpringSecurity.service;

import org.springframework.lang.Nullable;

import javax.validation.constraints.NotNull;
import java.util.Map;

public interface RedisService {

    void del(String... key);

    //--------------String----------------
    Object getObject(@NotNull String key);

    boolean setObject(@NotNull String key, Object value);

    boolean setObject(@NotNull String key, Object value, long time);

    boolean setIfAbsent(@NotNull String key, Object value);

    boolean setIfAbsent(@NotNull String key, Object value, long time);

    boolean setIfPresent(@NotNull String key, Object value);

    boolean setIfPresent(@NotNull String key, Object value, long time);

    long sizeObject(@NotNull String key);

    long incrementObject(@NotNull String key, long delta);

    long incrObject(@NotNull String key, long delta);

    long decrObject(@NotNull String key, long delta);

    boolean append(@NotNull String key, @Nullable String var2);

    //---------------Map------------------

    Object getMap(@NotNull String key, String mapKey);

    Map getMap(@NotNull String key);

    boolean setMap(@NotNull String key, Map map);

    boolean setMap(@NotNull String key, Map map, long time);

    boolean setMap(@NotNull String key, String mapKey, Object vale);

    boolean setMap(@NotNull String key, String mapKey, Object value, long time);

    long delMap(@NotNull String key, Object... mapKey);

    boolean selMap(@NotNull String key, String mapKey);

    double incrementMap(@NotNull String key, String mapKey, double by);

    double incrMap(@NotNull String key, String mapKey, double by);

    double decrMap(@NotNull String key, String mapKey, double by);
}
